import { Body, Controller, HttpCode, Post } from '@nestjs/common';
import { SESChannelService } from '../service/ses-channel.service';
import { SendEmailRequestDto } from '../dto/sendEmailRequest.dto';

@Controller('/channel/ses')
export class SESChannelController {
  constructor(private readonly sesChannelService: SESChannelService) {}

  @Post()
  @HttpCode(200)
  async sendEmail(@Body() sendEmailRequest: SendEmailRequestDto): Promise<boolean> {
    return this.sesChannelService.sendEmail(
      sendEmailRequest.subject,
      sendEmailRequest.to,
      sendEmailRequest.content,
    );
  }
}
